Skip to main content

Fill Document

The Fill Document service task takes a Microsoft Word file that has been prepared in accordance with the DocX standard and creates a copy pre-filled with data from within your process.

Workflow v1

Array Handling

To deal with an unknown number of items in a list DocX has implemented loops. In order to put the array into the service task use the JSON.stringify function to convert your array from within your process.

Document Example

{project.title | upper} Start: {project.start_date | endOf: ‘day’ | format: ‘dd-MM-yyyy'} {#project.tasks} {title} {start_date | format:’dd/MM/yy’} {due_date} {total | currency:’fil-PH’:’PHP’}{/}

Supported Filter Expressions

After the pipe are filter expressions. You can use these to alter the input text before it is placed in the document. Currently supported filter expressions include

ExpressionDescriptionExample
upperSets the text to be uppercase{project.title | upper}
endOfMoves a date to the end of the given unit*{project.start_date | endOf:'week'}
startOfMoves a date to the start of the given unit{project.start_date | startOf:'week'}
formatFormats a given date. See supported date formats{project.start_date | format:'dd-MM-yy'}
currencyFormats a given number to the specified locale and currency. Locale defaults to 'en-au' and currency defaults to 'AUD'{project.cost | currency:'en-de':'USD'}
whereFilters an array by the specified string expression{project.tasks | where:"status != 'Completed'"}
sumBySums an array by the specified field{projects.invoices | sumBy:"amount"}
parseGiven a bunch of JSON data in a string, parses into JSON object.{#projects.tasks | parse} {assigned_to} {}

*Units:

  • year
  • quarter
  • month
  • week
  • day
  • hour
  • minute
  • second
  • millisecond

Document Themes

You can set the Document theme values using the Theme tab. These values match up with the custom theme configurator found in Word. Do note that Word Online and Word the application have different behaviour when displaying themed documents. The following values will be ignored in Word locally, but display correctly in Word Online

Text/Background - Dark 1 : Sets to Black

Text/Background - Light 1 : Sets to White